<?php
require('conexion.php');
//error_reporting(0);
session_start();
if(isset($_SESSION['idsuc']))
$idsuc=$_SESSION['idsuc'];
if(isset($_SESSION['idemp']))
$idemp=$_SESSION['idemp'];
if(isset($_SESSION['idven']))
$idven=$_SESSION['idven'];
$conn->Execute('set lc_monetary=english');
?>
<style>
table{
	text-align:center;
	}
</style>
<table border="1">
<tr>
<th colspan="6">Datos de la empresa</th>
</tr>
<tr>
<td>Sucursal</td><td colspan="4">Direccion</td><td>Telefono</td>
</tr>

<?php
$sql = "select * from sucursal";
$rs = $conn->Execute($sql);
?>
        <tr>
        		<td><?php echo $rs->fields[0];?></td>
                <td><?php echo $rs->fields[1];?></td>
                <td><?php echo $rs->fields[2];?></td>
                <td><?php echo $rs->fields[3];?></td>
        		<td><?php echo $rs->fields[4];?></td>
                <td><?php echo $rs->fields[5];?></td>
                
        </tr>
</table>
         <br>
 <table border="1">
        <tr>
        <th colspan="4">Datos del empleado</th>
        </tr>
        <tr>
        <td colspan="2">Empleado</td>
        </tr>
        <tr>
        		<td><?php echo $rs->fields[6];?></td>
                <td><?php echo $rs->fields[7];?></td> 

		</tr>

	</table>
    <br>	
<table border="1">
<tr>
<th colspan="4">Datos de la venta</th>
</tr>
<tr>
<td>Producto</td><td>Fecha</td><td>Precio unitario</td><td>Cargo</td>
</tr>
<?php
$sql = "select * from ventas";
$rs = $conn->Execute($sql);
	foreach($rs as $i=>$k):?>
		<tr>
				<td><?php echo $k[0];?></td>
                <td><?php echo $k[1];?></td>
                <td><?php echo $k[2];?></td>
                <td><?php echo $k[3];?></td>
        </tr>
		<?php endforeach;?>
<tr>
<?

?>
<td colspan="3">Gracias x su compra</td>
<td><?php echo $rs->fields[0];?></td>
</tr>
</table>
<?
$conn->Execute('drop table tventa');
$conn->Execute('drop table tsuc');	
?>